# -*- coding:utf-8 -*-

from .models import *

def ensure_default_bucket():
    """
    确保默认的bucket存在
    :return:
    """
    try:
        default_bucket = FileCacheBucket.objects.get(name='default')
    except FileCacheBucket.DoesNotExist:
        default_bucket = FileCacheBucket(name='default')
        default_bucket.save()

def get_tmppath():
    return '%s/%s' % (FC_TMP_ROOT, gen_uuid32())